﻿package mortal.game.view.combinedServer.data
{
    import com.gengine.resource.*;

    public class CombinedSerConfig extends Object
    {
        public var targetArr:Array;
        private static var _instance:CombinedSerConfig;

        public function CombinedSerConfig()
        {
            this.targetArr = [];
            this.init();
            return;
        }// end function

        private function init() : void
        {
            var _loc_1:* = ConfigManager.instance.getJSONByFileName("t_recharge_active_config.json");
            this.writeTTarget(_loc_1);
            return;
        }// end function

        private function writeTTarget(param1:Object) : void
        {
            var _loc_2:* = param1 as Array;
            this.targetArr = _loc_2;
            this.targetArr.sortOn("id", Array.NUMERIC);
            return;
        }// end function

        public function getArrByGroup(param1:int) : Array
        {
            var _loc_4:Object = null;
            var _loc_2:Array = [];
            var _loc_3:int = 0;
            while (_loc_3 < this.targetArr.length)
            {
                
                _loc_4 = this.targetArr[_loc_3];
                if (_loc_4.group == param1)
                {
                    _loc_2.push(_loc_4);
                }
                _loc_3++;
            }
            return _loc_2;
        }// end function

        public static function instance() : CombinedSerConfig
        {
            if (_instance == null)
            {
                _instance = new CombinedSerConfig;
            }
            return _instance;
        }// end function

    }
}
